package org.zoomdev.zoom.dao.structs;

/**
 * 字段结构
 */
public class ColumnMeta {

    Class columnType;
    TableMeta tableMeta;
    int type;
    String name;
    KeyType keyType;
    boolean autoIncrement;

    public Class getColumnType() {
        return columnType;
    }

    public void setColumnType(Class columnType) {
        this.columnType = columnType;
    }

    public TableMeta getTableMeta() {
        return tableMeta;
    }

    public void setTableMeta(TableMeta tableMeta) {
        this.tableMeta = tableMeta;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public KeyType getKeyType() {
        return keyType;
    }

    public void setKeyType(KeyType keyType) {
        this.keyType = keyType;
    }

    public boolean isAutoIncrement() {
        return autoIncrement;
    }

    public void setAutoIncrement(boolean autoIncrement) {
        this.autoIncrement = autoIncrement;
    }


    public enum KeyType {
        /**
         * 主键
         */
        PRIMARY,

        /**
         * 唯一键（唯一约束）
         */
        UNIQUE,

        /**
         * 一般索引（不含有唯一索引）
         */
        INDEX
    }
}
